<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
	<head>
		<jsp:include page="../inc.jsp"></jsp:include>
		<script type="text/javascript" charset="utf-8">
	var datagrid;
	$(function() {

		datagrid = $('#datagrid').datagrid({
			url : 'goodsAmountAction!datagrid.html',
			title : '库存列表',
			iconCls : 'icon-save',
			pagination : true,
			pagePosition : 'bottom',
			pageSize : 10,
			pageList : [ 10, 20, 30, 40 ],
			fit : true,
			fitColumns : false,
			nowrap : false,
			border : false,
			idField : 'id',
			sortName : 'name',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : true,
			columns : [ [  {
				title : '商品条码',
				field : 'barcode',
				width : 100
			}, {
				title : '款号/款式',
				field : 'type',
				width : 100
			},{
				title : '单位',
				field : 'unit',
				width : 50
			}, {
				title : '颜色',
				field : 'color',
				width : 50
			}, {
				title : '尺码',
				field : 'size',
				width : 50
			}, {
				title : '库存总数',
				field : 'amount',
				width : 100
			}, {
				title : '所属仓库ID',
				field : 'rid',
				width : 50,
				hidden : true
			}, {
				title : '仓库名称',
				field : 'rname',
				width : 100
			} , {
				title : '商品名称',
				field : 'name',
				width : 100
			}, {
				title : '品牌ID',
				field : 'bid',
				width : 50,
				hidden : true
			},  {
				title : '品牌',
				field : 'bname',
				width : 100
			}, {
				title : '吊牌价',
				field : 'showPrice',
				width : 100
			}, {
				title : '总金额',
				field : 'total',
				width : 100
			}] ]
		});
		
		var bid0 = $('#searchForm').find('input[name=bid]');
		var bid0Combobox = bid0.combobox({
			url : '${pageContext.request.contextPath}/spgl/brandAction!noAuth_combobox.html',
			valueField : 'id',
			textField : 'name',
			multiple : false,
			editable : false,
			panelHeight : 'auto',
			onLoadSuccess : function() {
				parent.$.messager.progress('close');
			}
		});
		
		var rid0 = $('#searchForm').find('input[name=rid]');
		var rid0Combobox = rid0.combobox({
			url : '${pageContext.request.contextPath}/rkgl/repertoryAction!noAuth_combobox.html',
			valueField : 'id',
			textField : 'name',
			multiple : false,
			editable : false,
			panelHeight : 'auto',
			onLoadSuccess : function() {
				rid.combobox('setValue','${sessionInfo.repertoryIds}');
				parent.$.messager.progress('close');
			}
		});

	});

	function _search() {
		datagrid.datagrid('load', sy.serializeObject($('#searchForm')));
	}
	
	function cleanSearch() {
		datagrid.datagrid('load', {});
		$('#searchForm input').val('');
	}
</script>
	</head>
	<body class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north',border:false,title:'搜索条件'"
			style="height: 120px; overflow: hidden;">
			<form id="searchForm">
				<table class="tableForm datagrid-toolbar"
					style="width: 100%; height: 100%;">
					<tr>
						<th style="width: 80px;">商品条码</th>
						<td style="width: 200px;"><input name="barcode" style="width: 200px;" /></td>
						<th style="width: 80px;">款号/款式</th>
						<td style="width: 200px;"><input name="type" style="width: 200px;" /></td>
						<th style="width: 80px;">颜色</th>
						<td style="width: 200px;"><input name="color" style="width: 200px;" /></td>
					</tr>
					<tr>
						<th>尺码</th>
						<td><input name="size" style="width: 200px;" /></td>
						<th>所属仓库</th>
						<td><input name="rid" style="width: 200px;" /></td>
						<th>品牌</th>
						<td><input name="bid" style="width: 200px;" /></td>
					</tr>
					<tr>
						<td colspan="6" align="right" style="text-align:center">
							<a href="javascript:void(0);" class="easyui-linkbutton"
								onclick="_search();">搜索</a><a href="javascript:void(0);"
								class="easyui-linkbutton" onclick="cleanSearch();">取消</a>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div data-options="region:'center',border:false"
			style="overflow: hidden;">
			<table id="datagrid"></table>
		</div>
	</body>
</html>